using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class NAID_Scene {

	private Dictionary<int, NAID_Data.NAID_Node> nodes = new Dictionary<int, NAID_Data.NAID_Node>();
	
	private int currentNode = 0;
	
	public class Node
	{
		public int id;
		public string dialogue;
		
		public Node()
		{
		}
		
		public Node(int id, string dialogue)
		{
			this.id = id;
			this.dialogue = dialogue;
		}
	}
	
	public void AddNode(NAID_Data.NAID_Node node)
	{
		nodes.Add(node.id, node);
	}
	
	public void Start()
	{
		currentNode = 0;
	}
	
	public Node[] GetNodes()
	{
		List<Node> rets = new List<Node>();
		foreach(int id in nodes[currentNode].output)
		{
			Node ret = new Node(nodes[id].id, nodes[id].dialog);
			rets.Add(ret);
		}
		
		return rets.ToArray();
	}
	
	public void NextNode(Node next)
	{
		currentNode = next.id;
	}
}
